package nl.windgazer.arachne.components.google;

import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;

@Import(library="GoogleInteractiveMap.js")
public class GoogleInteractiveMap {

	//Injects and Persists

	@Inject
	private JavaScriptSupport _rs;

	//Properties and Parameters

	//Components

	//Events

	@SetupRender
	void setupExternalJS() {
		_rs.importJavaScriptLibrary("http://maps.google.com/maps/api/js?sensor=false");
		_rs.addInitializerCall("createNewGoogleMap", new JSONObject("id", "map_canvas"));
	}

	//Other (check for business-logic, it should not remain here)

}
